1. Field of the Invention
This invention relates to a decoding device for decoding encoded codes subjected to predictive coding, and more particularly, to countermeasures when a code error occurs in a transmission channel.
2. Description of the Related Art
As a method for reducing the number of transmitted bits for one sample when image information is digitally transmitted, a difference (or differential) predictive coding method (termed hereinafter a DPCM) has been known which compresses data utilizing the property that adjacent sample values have large correlation with each other.
FIG. 1 is a block diagram showing the configuration of a most common preceding-value-predictive DPCM encoding device. In FIG. 1, there is shown an input terminal 10 for a sampled value X.sub.i. A subtracter 12 subtracts an encode predictive value P.sub.i from the input sampled value X.sub.i. A quantizer 14 outputs an encoded Y.sub.i. There are also shown an inverse quantizer 16, and an adder 18. A D-flip-flop 20 outputs an encode predictive value. An error correcting coding circuit 22 adds an error correcting code to the encoded code Y.sub.i. An output terminal 24 is for a string of transmitted codes with error correcting codes added thereto.
The subtracter 12 subtracts the encode predictive value P.sub.i (consisting of 8 bits), which is a decoded value of the immediately preceding value output from the D-flip-flop 20, from the sampled value X.sub.i (consisting of 8 bits) from the input terminal 10. The quantizer 14 quantizes a difference value output from the subtracter 12, and outputs a DPCM-encoded code Y.sub.i (consisting of 4 bits). The error correcting coding circuit 22 adds a parity for error correction to the encoded code Y.sub.i output from the quantizer 14, and outputs the resultant signal to the output terminal 24. The inverse quantizer 16 inversely quantizes the DPCM-encoded code Y.sub.i (consisting of 4 bits) output from the quantizer 14, and outputs a representative quantized difference value of a difference (consisting of 8 bits). The adder 18 adds the encode predictive value P.sub.i to the output from the inverse quantizer 16, and outputs a local decoded value X.sub.i '. The D-flip-flop 20 delays the local decoded value X.sub.i ' for an interval of one sample, and supplies it to the subtracter 12 and the adder 18 as the encode predictive value P.sub.i.
In general, the generation probability of the difference value between the encode predictive value P.sub.i and the sampled value X.sub.i concentrates in very small values. Accordingly, by having a configuration in which regions having small difference values are finely quantized, and in which regions having large difference values are coarsely quantized, compression of the amount of information becomes possible.
Table 1 shows a correspondence relation among difference values (outputs from the subtracter 12), DPCM-encoded codes Y.sub.i output from the quantizer 14, and representative difference values output from the inverse quantizer 16.
TABLE 1 ______________________________________ Range of difference DPCM Representative difference value code value ______________________________________ -255--94 0 -140 -93--70 1 -80 -69--50 2 -58 -49--34 3 -40 -33--22 4 -27 -21--13 5 -17 -12--6 6 -8 -5--2 7 -3 -1-1 8 0 2-5 9 3 6-11 10 8 12-20 11 15 21-35 12 27 36-53 13 44 54-93 14 70 94-255 15 150 ______________________________________
As shown in Table 1, the quantizer 14 performs non-linear quantization, and as a result, compresses the amount of information to one half.
FIG. 2 shows a block diagram of the configuration of a decoding device corresponding to the encoding device shown in FIG. 1. In FIG. 2, there are shown an input terminal 26 for a transmitted DPCM-encoded code, an error detection/correction circuit 28, an inverse quantizer 30, an adder 32, a D-flip-flop 34, a switch 38, a 1-line delay unit 36, and an output terminal 40 for a decoded value.
In the transmitted code input from the input terminal 26, an error which occurred during data transmission is detected and corrected by the error detection/correction circuit 28. The error detection/correction circuit 28 supplies the inverse quantizer 30 with the DPCM-encoded code Y.sub.i, and outputs an error flag (see FIG. 3) for controlling the switch 38 if the error could not be corrected. The inverse quantizer 30 inversely quantizes the DPCM-encoded code Y.sub.i, and outputs a representative difference value. The adder 32 adds an output from the D-flip-flop, which is the decoded value of the immediately preceding value, to the output from the inverse quantizer 30. The output from the adder 32 becomes the decoded value X.sub.i '. The output from the adder 32 is delayed for an interval of one sample by the D-flip-flop 34, and is returned to the adder 32 as the decoded value (decode predictive value) of the immediately preceding value.
The output from the adder 32 is directly supplied to contact "a" of the switch 38, and is also supplied to contact "b" of the switch 38 via the 1-line delay unit 36. In general, in the DPCM, it is known that, when an error once occurs in a transmission channel, the error is propagated to succeeding decoded values X.sub.i+1 -X.sub.i+j until the decoded value (reset value) of the DPCM-encoded code obtained by quantizing the sampled value itself is subsequently obtained. Accordingly, when an uncorrectable error is detected in the encoded code Y.sub.i by the error detection/correction circuit 28, an error flag is raised after the detection of the uncorrectable error, as shown in FIG. 3. While the error flag is raised, the switch 38 is switched to the side of contact "b", and the decoded value is replaced, that is, concealed by the sampled value on the immediately preceding line. FIG. 3 shows changes in the decoded values by this concealment at respective sampled points.
In the above-described conventional example, however, since the decoded value is replaced by the sampled value on the immediately preceding line, there is a disadvantage in that a 1-line delay unit is needed, causing an increase in hardware. Furthermore, since all the decoded values after the detection of the uncorrectable encoded code are replaced, there is a disadvantage in that much deterioration in an image occurs if there is no correlation between a sampled value on the current line and a sampled value on the immediately preceding line. In such a case, the difference between the sampled value on the immediately preceding line and the sampled value in the case of no transmission-line error becomes large, as shown in FIG. 3, causing remarkable deterioration in picture quality.